#ifndef SDFCONTACT_H
#define SDFCONTACT_H

#include <vector>
#include <osg/Vec3>
#include <SDF.h>
class SDFContact : public osg::Node
{
public:
    SDFContact();
    virtual ~SDFContact();

    void addContactPoint(osg::Vec3& pos, osg::Vec3& normal);
    int getContactPointsCount();

    osg::Vec3 getContactPosByIndex(int index);
    osg::Vec3 getContactNormalByIndex(int index);

    SDF* getSDF1();
    SDF* getSDF2();

    void setSDF1( osg::ref_ptr<SDF> sdf);
    void setSDF2( osg::ref_ptr<SDF> sdf);

    bool chargeDirectionIsValid(osg::Vec3 direction);
    bool chargeDirectionIsValid(osg::ref_ptr<SDF> sdfPtr, osg::Vec3 direction);

    osg::Vec3 computeResultantForce();
protected:

private:
    std::vector<osg::Vec3> m_pos;
    std::vector<osg::Vec3> m_normals;//reference to sdf2
    osg::ref_ptr<SDF> m_sdf1;
    osg::ref_ptr<SDF> m_sdf2;
};

#endif // SDFCONTACT_H
